package com.itheima.advantagesup.mapper;

import com.itheima.advantagesup.entity.SysMenu;
import com.itheima.advantagesup.vo.MenuVO;
//import com.itheima.advantagesup.vo.MenuVo2;
import com.itheima.advantagesup.vo.MenuVO2;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * SysMenuMapper
 *
 * @author liliudong
 * @version 1.0
 * @description
 * @date 2023/7/26 17:57
 */
@Mapper
public interface SysMenuMapper {
    /**
     * 选择列表按角色id
     *
     * @param roleIds 角色ids
     * @return {@link List}<{@link SysMenu}>
     */
    List<SysMenu> selectListByRoleIds(List<String> roleIds);

    /**
     * 根据父类id查询结果
     * @param pid
     * @return
     */
    @Select("select * from sys_menu where pid = #{pid}")
    List<SysMenu> getAllDataByPId(int pid);

    void addMenu(MenuVO menuVO);

    @Delete("delete from sys_menu where id = #{id}")
    void deleteById(Integer id);

    void updateMenu(MenuVO menuVO);

    @Select("select * from sys_menu where id = #{id}")
    MenuVO2 rowInfo(Integer id);
}
